//
// Created by miaomiaole on 2023/5/18.
//

#ifndef CMAKECXX_BASE_1_H
#define CMAKECXX_BASE_1_H

#include <iostream>

extern int x_3;
using namespace std;

class Base_1 {

public:
    Base_1() {
        cout << "generate Base_1" << endl;
    }

    virtual  ~Base_1() {
        cout << "destroy Base_1 " << endl;
    }
};


class Base_2 {
    Base_1 *base1 = new Base_1();
public:
    Base_2() {
        cout << "generate Base_2" << endl;
    }

    ~Base_2() {
        cout << "destroy Base_2 " << endl;
    }
};

class Derived_2 : public Base_2 {

public:
    Derived_2() {
        cout << "generate Derived_2" << endl;
    }

    ~Derived_2() {
        cout << "destroy Derived_2" << endl;
    }
};

class Derived_1 : public Base_1 {
public:
    Derived_1() {
        cout << "generate Derived_1" << endl;
    }

    ~Derived_1() {
        cout << "destroy Derived_1" << endl;
    }
};


class Dog_3 : public Base_1 {
public:
    ~Dog_3() {
        cout << "destroy Dog_3" << endl;
    }
};


#endif //CMAKECXX_BASE_1_H
